//
//  PresidentListModel.m
//  UISplitViewControllerDemo
//
//  Created by student on 16/3/10.
//  Copyright © 2016年 NIIT. All rights reserved.
//

#import "PresidentListModel.h"

@implementation PresidentListModel

- (instancetype)initWithDict:(NSDictionary *)d
{
    self = [super init];
    if (self) {
        [self setValuesForKeysWithDictionary:d];
    }
    return self;
}

+ (instancetype)preseidentListDict:(NSDictionary *)d
{
    return [[self alloc] initWithDict:d];
}

+ (NSArray *)arr
{
     NSString *path = [[NSBundle mainBundle] pathForResource:@"PresidentList" ofType:@"plist"];
    NSDictionary *dict = [NSDictionary dictionaryWithContentsOfFile:path];
    NSArray *arr = dict[@"presidents"];
    NSMutableArray *mArr = [NSMutableArray array];
    for (NSDictionary *dict in arr) {
        PresidentListModel *m = [PresidentListModel preseidentListDict:dict];
        [mArr addObject:m];
    }
    return mArr;
}

@end
